package com.gxa.config;

import org.springframework.context.annotation.Bean;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author: 42818
 * @date: 2022/8/31 14:49
 * @Software: IntelliJ IDEA
 * @Package_Name: com.gxa.config
 * @ClassName: SwaggerConfig
 * @Description:
 **/
@EnableSwagger2
public class SwaggerConfig {

    @Bean
    public Docket api() {
        System.out.println("swagger----------");
        return new Docket(DocumentationType.SWAGGER_2)
                .select()
                .apis(RequestHandlerSelectors.any())
                .build()
                .apiInfo(apiInfo());
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("智慧园区项目接口文档")
                .description("接口测试")
                .version("1.0.0")
                .build();
    }
}

